package ace.module.captcha.sms.core.impl.dao.repository;

import ace.cmp.spring.data.jdbc.querydsl.core.repository.QuerydslJdbcBaseRepository;
import ace.module.captcha.sms.core.impl.constant.CaptchaSmsCoreConstants;
import ace.module.captcha.sms.core.impl.dao.entity.CaptchaSmsItem;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * 验证码 repository.
 *
 * @author Caspar
 */
@DS(CaptchaSmsCoreConstants.DEFAULT_DATA_SOURCE_NAME)
@Repository
public interface CaptchaSmsItemRepository extends QuerydslJdbcBaseRepository<CaptchaSmsItem, Long> {

  CaptchaSmsItem getByCaptchaSmsAppIdAndPhone(
      @Param("captchaSmsAppId") Long captchaSmsAppId, @Param("phone") String phone);
}
